home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / allhis.zip / ALLHIST.TXT next >
Text File  |  1992-01-09  |  4KB  |  96 lines

  1. This file shows how you can configure 4DOS to keep a complete
  2. consolidated history of all commands entered at the 4DOS prompt.
  3. It will keep history on all commands regardless of whether they
  4. are from a primary or a secondary 4DOS shell. This allows you to
  5. "push to DOS" from a program and run commands, and they will be
  6. remembered in the 4DOS history list after you EXIT.
  7.  
  8. Thanks to Mike Bessy of J.P. Software for the tricks that make
  9. this work.
  10.  
  11.  
  12. The Problem:
  13.  
  14.   You edit a program file or files in your editor.
  15.   You push from your editor to DOS (4DOS) to do a compile.
  16.   You enter several compile commands and discover errors.
  17.   You EXIT back to your editor and fix the errors.
  18.   You push to 4DOS to compile again.
  19.  
  20.   At this point, it would be nice to just press up arrow and get
  21.   the previous compile commands you entered. This is a standard
  22.   feature of MSDOS 5.0 DOSKEY or CED or PCED, but not 4DOS. Under
  23.   4DOS, the up arrow key will give you the command which invoked
  24.   the editor.
  25.  
  26.   This is because 4DOS provides a separate history for each 4DOS
  27.   shell. You started a new 4DOS shell when you "pushed" from your
  28.   editor. The new shell "inherited" the history list of the
  29.   parent shell, so you have the previous commands up to the
  30.   editor command line. But after you run your new commands, the
  31.   history is not passed back to the parent when you exit the
  32.   shell. It is just discarded. So if you push to a secondary
  33.   shell again, the commands you entered in the previous secondary
  34.   shell are gone, and you can't recall your compile commands from
  35.   history. The same thing happens when you exit from the editor.
  36.   None of your compile commands you entered in the secondary
  37.   shells you "pushed to" are remembered.
  38.  
  39.  
  40. A Solution:
  41.  
  42.   Here is how I configured 4DOS to save history from secondary
  43.   shells. I have RAMDISK as drive E:. You may need to adjust
  44.   directories and other things for your own configuration.
  45.  
  46. 1) Put the following commands in AUTOEXEC.BAT:
  47.  
  48.    alias /r c:\4dos\alias.cmd
  49.    copy c:\4dos\4exit.btm e:
  50.    prompt %%@EXEC[readhist]$h$P$G
  51.  
  52. 2) Have the following ALIAS defined in C:\4DOS\ALIAS.CMD:
  53.  
  54.     readhist = iff exist e:\history then ^ history /f ^
  55.                history /r e:\history ^ del /q e:\history ^ endiff
  56.    (Note: the above is all one long line, not two lines.)
  57.  
  58. 3) Have the following command in C:\4DOS\4EXIT.BTM:
  59.  
  60.    @history >!e:\history
  61.  
  62. 4) Have the following command in C:\4DOS\4DOS.INI:
  63.  
  64.    4StartPath = e:\
  65.  
  66. 5) Re-boot your computer to get everything to be set up with
  67.    4DOS (be sure you have a bootable floppy handy in case
  68.    something is wrong and the system doesn't boot).
  69.  
  70.  
  71. How it works:
  72.  
  73.   Each time the 4DOS prompt is generated, the %@EXEC function in
  74.   the PROMPT string causes 4DOS to execute alias READHIST.
  75.   READHIST looks on RAM disk for a saved history file E:\HISTORY.
  76.   If it finds it, it loads it into the history buffer and deletes
  77.   the file. This E:\HISTORY file is created when a seconadary
  78.   4DOS shell is EXITed. The 4EXIT.BTM command causes the final
  79.   history list of the secondary shell to be written to
  80.   E:\HISTORY. The history will be reloaded at the next occurance
  81.   of the 4DOS prompt.
  82.  
  83.  
  84. Suggestions:
  85.  
  86.   I would like to suggest to J.P. Software that they make an
  87.   option in a future 4DOS version to allow a single consolidated
  88.   history list. The technique described above works, but requires
  89.   a disk access on every prompt. Using RAM disk, this is not
  90.   noticeable, but the technique is obscure, at best. A
  91.   consolidated history would record every command entered at a
  92.   4DOS prompt regardless of whether it was a primary or secondary
  93.   shell.
  94.  
  95. - Bob Snider, 70000,302, 1/9/92.
  96.